package com.zsqx.model;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * School entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "school", schema = "dbo", catalog = "test")
public class School implements java.io.Serializable {

	// Fields

	private Integer id;
	private String name;
	private String des;
	private Date createtime;
	private Date modifytime;
	private Set<Student> schStudents = new HashSet<Student>(0);

	// Constructors

	/** default constructor */
	public School() {
	}

	/** full constructor */
	public School(String name, String des, Date createtime,
			Date modifytime) {
		this.name = name;
		this.des = des;
		this.createtime = createtime;
		this.modifytime = modifytime;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "name", length = 50)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "des", length = 500)
	public String getDes() {
		return this.des;
	}

	public void setDes(String des) {
		this.des = des;
	}

	@Column(name = "createtime", length = 23)
	public Date getCreatetime() {
		return this.createtime;
	}

	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}

	@Column(name = "modifytime", length = 23)
	public Date getModifytime() {
		return this.modifytime;
	}

	public void setModifytime(Date modifytime) {
		this.modifytime = modifytime;
	}

	@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="school")
	public Set<Student> getSchStudents() {
		return schStudents;
	}

	public void setSchStudents(Set<Student> schStudents) {
		this.schStudents = schStudents;
	}

	
}